package cn.iocoder.yudao.module.jikong.dal.mysql.project;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.jikong.dal.dataobject.project.JkProjectDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.jikong.controller.admin.project.vo.*;

/**
 * 项目列表 Mapper
 *
 * @author admin
 */
@Mapper
public interface JkProjectMapper extends BaseMapperX<JkProjectDO> {

    default PageResult<JkProjectDO> selectPage(JkProjectPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<JkProjectDO>()
                .likeIfPresent(JkProjectDO::getName, reqVO.getName())
                .eqIfPresent(JkProjectDO::getAreaId, reqVO.getAreaId())
                .eqIfPresent(JkProjectDO::getProjectType, reqVO.getProjectType())
                .betweenIfPresent(JkProjectDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(JkProjectDO::getId));
    }

}